<?php

class Tag_Name{
	static $XSL;
}

Tag_Name::$XSL = <<<EOD
<xsl:template match="i:name">
<xsl:variable name="url">
<xsl:choose>
	<xsl:when test="@url">
	<xsl:value-of select="@url"/>
	</xsl:when>
	<xsl:otherwise>
	/?uid=<xsl:value-of select="@uid"/>
	</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="title">
<xsl:choose>
	<xsl:when test="@title">
	<xsl:value-of select="@title"/>
	</xsl:when>
	<xsl:otherwise>
	<xsl:value-of select="@username"/>
	</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a class="{@class}" title="{\$title}">
<xsl:attribute name="href">
	<xsl:value-of select="\$url"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="@length">
<script>
document.write('<xsl:value-of select="@username"/>'.truncateCn(<xsl:value-of select="@length"/>));
</script>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@username"/>
</xsl:otherwise>
</xsl:choose>

</a>
</xsl:template>
EOD;
